package com.egene.tw.data;

import com.egene.tw.activity.signs.BarChartData;
import com.egene.tw.activity.signs.BarChartItemData;
import com.egene.tw.data.entity.BloodData;
import com.egene.tw.data.entity.FatigueData;
import com.egene.tw.data.entity.HeartData;
import com.egene.tw.data.entity.NetResult;
import com.egene.tw.data.entity.OxygenData;
import com.egene.tw.data.entity.SleepData;
import com.egene.tw.data.entity.StepData;
import com.egene.tw.data.wrapper.HomeData;
import com.egene.tw.data.wrapper.OneKeyMeasureData;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by wzx on 2018/6/29.
 */

public interface EDataSource {
    ///////////////////////////////////////////////////////////////////////////
    // 心率
    ///////////////////////////////////////////////////////////////////////////
    Observable<Object> saveHeartData(long time, int value);

    Observable<List<HeartData>> heartDataList();

    Observable<BarChartData> heartBarDataByDay(long time);

    Observable<BarChartData> heartBarDataByWeek(long time);

    Observable<BarChartData> heartBarDataByMonth(long time);

    Observable<int[]> heartAnalysisByDay(long time);

    Observable<int[]> heartAnalysisByWeek(long time);

    Observable<int[]> heartAnalysisByMonth(long time);

    ///////////////////////////////////////////////////////////////////////////
    // 血氧
    ///////////////////////////////////////////////////////////////////////////
    Observable<Object> saveOxygenData(long time, int value);

    Observable<List<OxygenData>> oxygenDataList();

    Observable<BarChartData> oxygenBarDataByDay(long time);

    Observable<BarChartData> oxygenBarDataByWeek(long time);

    Observable<BarChartData> oxygenBarDataByMonth(long time);

    Observable<int[]> oxygenAnalysisByDay(long time);

    Observable<int[]> oxygenAnalysisByWeek(long time);

    Observable<int[]> oxygenAnalysisByMonth(long time);

    ///////////////////////////////////////////////////////////////////////////
    // 血压
    ///////////////////////////////////////////////////////////////////////////
    Observable<Object> saveBloodData(long time, int valueHigh, int valueLow);

    Observable<List<BloodData>> bloodDataList();

    Observable<BarChartData> bloodBarDataByDay(long time);

    Observable<BarChartData> bloodBarDataByWeek(long time);

    Observable<BarChartData> bloodBarDataByMonth(long time);

    Observable<int[]> bloodAnalysisByDay(long time);

    Observable<int[]> bloodAnalysisByWeek(long time);

    Observable<int[]> bloodAnalysisByMonth(long time);

    ///////////////////////////////////////////////////////////////////////////
    // 疲劳
    ///////////////////////////////////////////////////////////////////////////
//    Observable<Object> saveFatigueData(long time, int value);

    Observable<List<FatigueData>> fatigueDataList();

    Observable<BarChartData> fatigueBarDataByDay(long time);

    Observable<BarChartData> fatigueBarDataByWeek(long time);

    Observable<BarChartData> fatigueBarDataByMonth(long time);

    Observable<float[]> fatigueAnalysisByDay(long time);

    Observable<float[]> fatigueAnalysisByWeek(long time);

    Observable<float[]> fatigueAnalysisByMonth(long time);


    ///////////////////////////////////////////////////////////////////////////
    // 步数
    ///////////////////////////////////////////////////////////////////////////
    Observable<StepData> stepBarDataByDay(long time);

    Observable<BarChartData> stepBarDataByWeek(long time);

    Observable<BarChartData> stepBarDataByMonth(long time);

    Observable<StepData> stepAnalysisByDay(long time);

    Observable<StepData> stepAnalysisByWeek(long time);

    Observable<StepData> stepAnalysisByMonth(long time);

    ///////////////////////////////////////////////////////////////////////////
    // 睡眠
    ///////////////////////////////////////////////////////////////////////////
    Observable<SleepData> sleepBarDataByDay(long time);

    Observable<BarChartData> sleepBarDataByWeek(long time);

    Observable<BarChartData> sleepBarDataByMonth(long time);

    Observable<SleepData> sleepAnalysisByDay(long time);

    Observable<SleepData> sleepAnalysisByWeek(long time);

    Observable<SleepData> sleepAnalysisByMonth(long time);

    ///////////////////////////////////////////////////////////////////////////
    // 一键测量
    ///////////////////////////////////////////////////////////////////////////
    Observable<Object> saveOneKeyData(long time, OneKeyMeasureData data);

    //
    Observable<HomeData> homeData();

    //处理下拉数据
    Observable<Object> saveDropDownData(
            List<StepData> stepDataList, List<SleepData> sleepDataList
            , List<HeartData> heartDataList, List<OxygenData> oxygenDataList
            , List<BloodData> bloodDataList, List<FatigueData> fatigueDataList);


    ///////////////////////////////////////////////////////////////////////////
    //
    ///////////////////////////////////////////////////////////////////////////
    Observable<Object> uploadStep();

    Observable<NetResult> uploadStep(StepData data);

    Observable<Object> uploadSleep();

    Observable<NetResult> uploadSleep(SleepData data);

    Observable<Object> uploadHeart();

    Observable<NetResult> uploadHeart(HeartData data);

    Observable<Object> uploadBlood();

    Observable<NetResult> uploadBlood(BloodData data);

    Observable<Object> uploadOxygen();

    Observable<NetResult> uploadOxygen(OxygenData data);

    Observable<Object> uploadFatigue();

    Observable<NetResult> uploadFatigue(FatigueData data);

    Observable<Object> uploadData();

    Observable<FatigueData> saveFatigueData(long time, OneKeyMeasureData data);

    Observable<Object> delAllData();
}
